<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="inet.util.StringTool"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="inet.db.tennis.TennisRound"%>
<jsp:useBean id="tennisRoundDAO" class="inet.db.tennis.TennisRoundDAO" scope="session"/>
<%
	request.setCharacterEncoding("UTF-8");
	response.setCharacterEncoding("UTF-8");
	String sPhaseId = request.getParameter("phaseId");
	
	if( sPhaseId == null || !StringTool.isNumberic(sPhaseId)) {
		return;
	}

	Vector<TennisRound> vRound = tennisRoundDAO.findAll(new BigDecimal(sPhaseId));
	if(vRound != null && !vRound.isEmpty()) {
		TennisRound round = null;
%>
	<select id="select" name="slbRoundId">
		<option value="0"> -Chọn vòng đấu- </option>
<%
		for (Iterator it = vRound.iterator(); it.hasNext(); ){
			round = (TennisRound) it.next();
			if(round== null) continue;
%>
			<option value="<%= round.getRoundCode() %>"><%=round.getRoundCode() %></option>
<%
		}
%>
	</select>
<%	
	} else {
		out.println("Chưa có vòng đấu cho giai đoạn này");
	}
%>